package nl.scalasim
package actors
package traits

/**
 * Actors that can process Stop messages, causing the actor
 * to exit() 
 *
 * @author Yigal Duppen
 * @since Oct 2, 2010
 */
trait StoppableActor extends ComposedActor
        with Logging
{

  def handleStop(): PartialFunction[Any, Unit] = {
    case Stop => {
      log.info("Received stop message")
      exit()
    }
  }

  callbacks :+= handleStop
}